package com.isoft.demo01.controller;
import com.isoft.demo01.bean.ResponseData;
import com.isoft.demo01.bean.ResultCode;
import com.isoft.demo01.entity.Shop;
import com.isoft.demo01.service.ShopFindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@CrossOrigin
@RestController
@RequestMapping("shopfind")
public class ShopFindController {

    @Autowired
    private ShopFindService shopFindService;

    @GetMapping( "/list")
    public ResponseData listShop(@RequestBody Shop shop) {
        return getRep(shopFindService.listShop(shop));
    }
    private ResponseData getRep(Object o) {
        ResponseData rep = new ResponseData<>();
        rep.setErrorCode(ResultCode.SUCCESS.getCode());
        rep.setMsg(ResultCode.SUCCESS.getMessage());
        rep.setData(o);
        return rep;
    }

}
